package com.fub.guidance;


public class Wall {

	private String buildingId;
	private int x1;
	private int y1;
	private int x2;
	private int y2;
	private int z;

	/**
	 * Constructs a new wall.
	 * 
	 * @param buildingId
	 *            the id of the wall
	 * @param x1
	 *            the x value of the first point
	 * @param y1
	 *            the y value of the first point
	 * @param x2
	 *            the x value of the second point
	 * @param y2
	 *            the y value of the second point
	 * @param z
	 *            the z value of the wall
	 */
	public Wall(String buildingId, int x1, int y1, int x2, int y2, int z) {
		this.buildingId = buildingId;
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
		this.z = z;
	}

	/**
	 * Returns the building id of this wall.
	 * 
	 * @return the building id of this wall.
	 */
	public String getBuildingId() {
		return this.buildingId;
	}

	/**
	 * Returns the start position of this wall.
	 * 
	 * @return the start position of this wall.
	 */
	public Point getPositonFrom() {
		Point from = new Point(this.x1, this.y1, this.z);
		return from;
	}

	/**
	 * Returns the end position of this wall.
	 * 
	 * @return the end position of this wall
	 */
	public Point getPositionTo() {
		Point to = new Point(this.x2, this.y2, this.z);
		return to;
	}

	/**
	 * Returns the the x position of the start position.
	 * 
	 * @return the the x position of the start position
	 */
	public int getX1() {
		return this.x1;
	}

	/**
	 * Returns the the y position of the start position.
	 * 
	 * @return the the y position of the start position
	 */
	public int getY1() {
		return this.y1;
	}

	/**
	 * Returns the the x position of the end position.
	 * 
	 * @return the the x position of the end position
	 */
	public int getX2() {
		return this.x2;
	}

	/**
	 * Returns the the y position of the end position.
	 * 
	 * @return the the y position of the end position
	 */
	public int getY2() {
		return this.y2;
	}

	/**
	 * Returns the the z position of this wall.
	 * 
	 * @return the z position of this wall
	 */
	public int getZ() {
		return this.z;
	}

	@Override
	public String toString() {
		return String.format("Level %d from %d,%d to %d,%d", this.z, this.x1, this.y1, this.x2, this.y2);
	}
}
